import Vue from 'vue'
import VueRouter from 'vue-router'
//个人中心的页面导入
import PersonalCenterView from '../views/userInfo/PersonalCenterView.vue'
import UserInfo from "../views/userInfo/UserInfo.vue"
import UserCourse from "../views/userInfo/Course.vue"
import UserCamp from "../views/userInfo/Camp.vue"
import UserWeight from "../views/userInfo/Weight.vue"
import UserBMI from "../views/userInfo/BMIVue.vue"
import UserWallet from "../views/userInfo/WalletVue.vue"
import AddBodyData from "../views/userInfo/AddBodyData.vue"
//首页登录注册页面的导入
import Leading_end from '../views/homepage/Leading_end.vue'
import Leading_endList from '../views/homepage/Leading_endList.vue'
import login from '../views/homepage/login.vue'
import register from '../views/homepage/register.vue'
//社区的页面导入
import BbsView from '../views/bbs/BbsView.vue'
import RecommendDynamic from '../views/bbs/RecommendDynamic.vue'
import AttentionDynamic from '../views/bbs/AttentionDynamic.vue'
import DynamicIssue from '../views/bbs/DynamicIssue.vue'
import UserInfoDynamic from '../views/bbs/UserInfoDynamic.vue'
import UpdateUserInfo from '../views/bbs/UpdateUserInfo.vue'
import DynamicContent from '../views/bbs/DynamicContent.vue'
//营养管理页面的导入
import DietAndFoodMainView from '../views/DietAndFood/DietAndFoodMainView.vue'
import BuildMusclesFoodView from '../views/DietAndFood/BuildMusclesFoodView.vue'
import FatReductionFoodView from '../views/DietAndFood/FatReductionFoodView.vue'
import FatReductionSystemCookbookView from '../views/DietAndFood/FatReductionSystemCookbookView.vue'
import GoutFoodView from '../views/DietAndFood/GoutFoodView.vue'
import HealthClassicalSystemCookbookView from '../views/DietAndFood/HealthClassicalSystemCookbookView.vue'
import HotFoodView from '../views/DietAndFood/HotFoodView.vue'
import SystemCookbookRecommendationView from '../views/DietAndFood/SystemCookbookRecommendationView.vue'
import UserCookbookShowView from '../views/DietAndFood/UserCookbookShowView.vue'
import UserCookbookMakeView from '../views/DietAndFood/UserCookbookMakeView.vue'

Vue.use(VueRouter)

const routes = [{
		//首页导航栏的路由
		path: '/Leading_end',
		name: 'Leading_end',
		component: Leading_end,
		// 子路由
		children: [
			{
				//首页内容的路由
				path: '/Leading_end/',
				name: 'Leading_endList',
				component: Leading_endList
			},
			{
				//个人中心的内容路由
				path: '/personalCenter',
				name: 'personalCenter',
				component: PersonalCenterView,
				children: [{
						path: "/personalCenter/",
						name: "userInfo",
						component: UserInfo
					},
					{
						path: "/userCourse",
						name: "course",
						component: UserCourse
					},
					{
						path: "/userCamp",
						name: "camp",
						component: UserCamp
					},
					{
						path: "/userWeight",
						name: "weight",
						component: UserWeight
					},
					{
						path: "/userBMI",
						name: "bmi",
						component: UserBMI
					},
					{
						path: "/userWallet",
						name: "wallet",
						component: UserWallet
					},
					{
						path: "/addBodyData",
						name: "addBodyData",
						component: AddBodyData
					},
				]

			},
			{
				//社区的内容路由
			  path: '/bbsView',
			  name: 'bbsView',
			  component: BbsView,
				children:[
					{
					  path: '/recommendDynamic',
					  name: 'recommendDynamic',
					  component: RecommendDynamic
					},
					{
					  path: '/attentionDynamic',
					  name: 'attentionDynamic',
					  component: AttentionDynamic
					},
					{
					  path: '/dynamicIssue',
					  name: 'dynamicIssue',
					  component: DynamicIssue
					},
					{
					  path: '/userInfoDynamic',
					  name: 'UserInfoDynamic',
					  component: UserInfoDynamic
					},
					{
					  path: '/updateUserInfo',
					  name: 'UpdateUserInfo',
					  component: UpdateUserInfo
					}
				]
			},
			{ //营养管理的主页子路由
				path: '/DietAndFoodMainView',
				component: DietAndFoodMainView,
				children: [
					{
						path: '/hotFood',
						component: HotFoodView
					},
					{
						path: '/fatReductionFood',
						component: FatReductionFoodView
					},
					{
						path: '/buildMusclesFood',
						component: BuildMusclesFoodView
					},
					{
						path: '/goutFood',
						component: GoutFoodView
					},
					{
						path: '/fatReductionSystemCookbook',
						component: FatReductionSystemCookbookView
					},
					{
						path: '/healthClassicalSystemCookbook',
						component: HealthClassicalSystemCookbookView
					},
					{
						path: '/systemCookbookRecommendation',
						component: SystemCookbookRecommendationView
					},
					{
						path: '/userCookbookShow',
						component: UserCookbookShowView
					},
					{
						path: '/userCookbookMake',
						component: UserCookbookMakeView
					}
				]
			}
			
		]
	},{
	path: '/',
	name: 'login',
	component: login,
},{
	path: '/register',
	name: 'register',
	component: register,
}


]

const router = new VueRouter({
	mode: 'history',
	base: process.env.BASE_URL,
	routes
})

export default router
